<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center participationRecords_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub participationRecords_fd0_0'>
          <view class='flex flex-wrap align-center participationRecords_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <text class='fu-iconfont2  participationRecords_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='participationRecords_fd0_0_c1_c0'>参局记录</text>
          </view>
          <view class='flex flex-wrap align-center justify-end participationRecords_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center participationRecords_flex_1">
        <view>
          <benben-flex-tabs class-name='participationRecords_benbenTabsfd1_0' v-model="tabls" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='false' :top='0'
            @change="getparticipateListFunc" :is-show-content='false' :scrollspy='false'
            :tabs-info.sync="tabsInfofd1_0">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex flex align-center justify-around">
                  <view :class="{ 'checkTitlefd1_0': tabls == '0', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '0'" :id="`benben_tabsfd1_0-title-item-${'0'}`">

                    <text>全部</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabls == '1', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

                    <text>审核中</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabls == '2', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

                    <text>已参与</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabls == '3', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

                    <text>未参与</text>

                  </view>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line"
                  class="benben-tabs-line flex benben-flex-tabs-line participationRecords_linefd1_0"></view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout participationRecords_flex_2">
        <template v-for='(item,key0) in dataList'>
          <view class='flex flex-direction flex-wrap align-stretch participationRecords_fd2_0' :key='key0'
            @tap.stop="handleJumpDiy" data-type="navigateTo"
            :data-url="`/pages/zuju/organizationalDetails/organizationalDetails?aid=${item.postoffice_id}`">
            <view class='flex flex-wrap align-center'>
              <image class='participationRecords_fd2_0_c0_c0' mode="aspectFit" :src='item.avatar'></image>
              <view class='flex flex-direction flex-wrap align-start'>
                <view class='flex flex-wrap align-center qrganizationalBureau_fd1_0_c1'>
                  <text class='qrganizationalBureau_fd1_0_c1_c0'>{{item.user_nickname}}</text>
                </view>
                <view class='text-cut participationRecords_fd2_0_c0_c1_c0' style="width: 500rpx;">{{item.title}}
                </view>
                <!-- <view class='flex flex-wrap align-center'>
                  <view class=' participationRecords_fd2_0_c0_c1_c1_c0'>
                    {{item.postofficecate_cate_name}}
                  </view>
                </view> -->
              </view>
            </view>
            <view class='flex flex-wrap align-center organizationalDetails_fd1_0_c0_c0_c1_c1'>
              <text class='organizationalDetails_fd1_0_c0_c0_c1_c1_c0'>{{item.create_time}}</text>
              <view class='text-cut organizationalDetails_fd1_0_c0_c0_c1_c1_c1' style="width:350rpx;">
                来自{{item.user_school}}
              </view>
            </view>
            <view class='flex  align-center margin-tb-xs'>
              <view class='flex flex-wrap align-center'>
                <text class='participationRecords_fd2_0_c0_c1_c1_c0'>{{item.postofficecate_cate_name}}</text>
              </view>
              <view class=' text-df text-333 text-cut' style="width: 450rpx;">{{item.content}}</view>
            </view>
            <!-- <view class='flex flex-wrap align-center participationRecords_fd2_0_c1'>
              <text class='participationRecords_fd2_0_c1_c0'>{{item.title}}</text>
            </view> -->
            <view class='flex flex-wrap align-center participationRecords_fd2_0_c2'>
              <view class='flex flex-wrap align-center'>
                <image class='participationRecords_fd2_0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"27.png"'></image>
                <text class='participationRecords_fd2_0_c2_c0_c1'>{{item.office_time}}</text>
              </view>
            </view>
            <view class='flex align-center justify-between participationRecords_fd2_0_c2'>
              <view class='flex align-center'>
                <image class='participationRecords_fd2_0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"29.png"'></image>
                <text class='participationRecords_fd2_0_c2_c0_c1'>{{item.address || '待定'}}</text>
              </view>
              <view class='flex flex-wrap align-center' v-if="item.distance">
                <text class='participationRecords_fd2_0_c3_c1_c0'>{{item.distance}}</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center justify-between participationRecords_fd2_0_c2'>
              <view class='flex flex-wrap align-center'>
                <image class='participationRecords_fd2_0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"30.png"'></image>
                <text class='participationRecords_fd2_0_c2_c0_c1'>{{item.people_num}}</text>
                <text class='participationRecords_fd2_0_c2_c0_c1'>人局</text>
                <text class='participationRecords_fd2_0_c4_c0_c3'>|</text>
                <text class='participationRecords_fd2_0_c2_c0_c1'>差</text>
                <text class='participationRecords_fd2_0_c2_c0_c1'>{{item.need_people}}</text>
                <text class='participationRecords_fd2_0_c2_c0_c1'>人</text>
                <text class='qrganizationalBureau_fd1_0_c2_c0_c1' style="color: #6450eb;" @tap.stop="handleJumpDiy"
                  data-type="navigateTo"
                  :data-url="`/pages/wode/participationRecord/participationRecord?aid=${item.aid}`"
                  v-if=" item.is_apply==0">瞧瞧都有谁？</text>
              </view>
              <view class='flex flex-wrap align-center'>
                <!-- <text class='participationRecords_fd2_0_c3_c1_c0'>熟人含量</text> -->
                <text class='participationRecords_fd2_0_c3_c1_c0'>{{item.know}}</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center participationRecords_fd2_0_c2'>
              <view class='flex flex-wrap align-center'>
                <image class='participationRecords_fd2_0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"28.png"'></image>
                <text class='participationRecords_fd2_0_c2_c0_c1'>人均费用：</text>
                <!-- <text class='participationRecords_fd2_0_c2_c0_c1'>$</text> -->
                <text class='participationRecords_fd2_0_c2_c0_c1'>{{item.money}}</text>
              </view>
            </view>
            <!-- @click.stop="clear_officeapply(item)" -->
            <button class='participationRecords_fd2_0_c6' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/wode/participationRecord/participationRecord?aid=${item.postoffice_id}`"
              v-if=" item.check_status=='1'">参与列表（审核中）</button>
            <button class='participationRecords_fd2_0_c6_1' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/wode/participationRecord/participationRecord?aid=${item.postoffice_id}`"
              v-if=" item.check_status=='3'">已拒绝参加</button>
            <button class='participationRecords_fd2_0_c6' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/wode/participationRecord/participationRecord?aid=${item.postoffice_id}`"
              v-if=" item.check_status=='2'">参与列表</button>
            <button class='participationRecords_fd2_0_c6_1' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/wode/participationRecord/participationRecord?aid=${item.postoffice_id}`"
              v-if=" item.check_status=='4'">已取消</button>
            <view class='flex flex-wrap align-center justify-between participationRecords_fd2_0_c7'>
              <view class='flex flex-wrap align-center'>
                <image class='participationRecords_fd2_0_c7_c0_c0' mode="aspectFit" :src='STATIC_URL+"24.png"'
                  v-if=" item.is_collection==0"></image>
                <image class='participationRecords_fd2_0_c7_c0_c0' mode="aspectFit" :src='STATIC_URL+"83.png"'
                  v-if=" item.is_collection=='1'"></image>
                <text class='participationRecords_fd2_0_c3_c1_c0'>{{item.collection_number}}</text>
              </view>
              <view class='flex flex-wrap align-center'>
                <image class='participationRecords_fd2_0_c7_c0_c0' mode="aspectFit" :src='STATIC_URL+"26.png"'></image>
                <text class='participationRecords_fd2_0_c3_c1_c0'>{{item.comment_number}}</text>
              </view>
              <view class='flex flex-wrap align-center'>
                <image class='participationRecords_fd2_0_c7_c0_c0' mode="aspectFit" :src='STATIC_URL+"25.png"'></image>
                <text class='participationRecords_fd2_0_c3_c1_c0'>{{item.share_num}}</text>
              </view>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "tabls": "0",
        "dataList": [],
        "cancel": "",
        "postoffice_id": "",
        "action": "",
        address: {
          latitude: '',
          longitude: '',
          city: ''
        },
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let that = this
      // #ifdef APP
      if (uni.getStorageSync('gugeaddress')) {
        that.address.latitude = uni.getStorageSync("gugeaddress").latitude
        that.address.longitude = uni.getStorageSync("gugeaddress").longitude
        that.address.city = uni.getStorageSync("gugeaddress").addresstxt
        that.getparticipateListFunc()
      } else {
        uni.getLocation({
          type: 'wgs84',
          // #ifdef APP
          geocode: true,
          // #endif
          isHighAccuracy: true,
          success: adr => {
            console.log('adradradradr', adr)
            const obj = {
              latitude: adr.latitude,
              longitude: adr.longitude,
              addresstxt: ''
            }
            uni.setStorageSync('gugeaddress', obj)
            that.address = uni.getStorageSync('gugeaddress')
            that.getparticipateListFunc()
          },
          fail: fail => {
            that.$message.info(JSON.stringify(complete))
            console.log('complete', complete)
          }
        })
      }
      // #endif
      // #ifdef H5
      this.getparticipateListFunc()
      // #endif
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      clear_officeapply(item) {
        this.$api.post(global.apiUrls.post657a60c34225e, {
          postoffice_id: item.postoffice_id
        }).then(res => {
          if (res.data.code == 1) {
            this.getparticipateListFunc()
          } else {
            this.$message.info(res.data.msg)
          }
        })
      },
      //获取参加记录
      getparticipateListFunc() {
        this.minixPagingListsApi = global.apiUrls.post657bb19504586;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          check_status: this.tabls,
          lat: this.address.latitude,
          lng: this.address.longitude,
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .organizationalDetails_fd1_0_c0_c0_c1_c1_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 0rpx 0rpx 0;
  }

  .organizationalDetails_fd1_0_c0_c0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    // margin-left: 24rpx;
  }

  .organizationalDetails_fd1_0_c0_c0_c1_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .qrganizationalBureau_fd1_0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 42rpx;
  }

  .qrganizationalBureau_fd1_0_c1 {
    margin: 0 0rpx 16rpx 0rpx;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 248, 1);
    background-size: 100% auto;
  }

  .participationRecords_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .participationRecords_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .participationRecords_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .participationRecords_fd0_0_c0 {
    width: 120rpx;
  }

  .participationRecords_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .participationRecords_flex_1 {
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
  }

  .participationRecords_linefd1_0 {
    background: rgba(100, 80, 235, 1);
    width: 48rpx;
    height: 6rpx;
    top: 80rpx;
    background-size: 100% auto !important;
    border-radius: 8rpx;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: #333 !important;
    background-color: rgba(255, 255, 255, 1) !important;
  }

  ::v-deep .participationRecords_benbenTabsfd1_0 {
    width: 750rpx;
    height: 98rpx;
    white-space: nowrap;
    text-align: center;
    font-size: 28rpx;
    font-weight: 400;
    color: #999999;
  }

  .participationRecords_flex_2 {
    padding: 24rpx 32rpx 0rpx 32rpx;
  }

  .participationRecords_fd2_0_c7_c0_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 12rpx 0rpx 0rpx;
  }

  .participationRecords_fd2_0_c7 {
    border-top: 1px solid #eee;
    padding: 32rpx 0rpx 0rpx 0rpx;
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .participationRecords_fd2_0_c6_1 {
    background: rgba(248, 248, 248, 1);
    border-radius: 44rpx;
    width: 638rpx;
    line-height: 80rpx;
    font-size: 32rpx;
    color: #666;
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .participationRecords_fd2_0_c6 {
    border: 1px solid rgba(100, 80, 235, 1);
    background: rgba(255, 255, 255, 1);
    border-radius: 44rpx;
    width: 638rpx;
    line-height: 80rpx;
    font-size: 32rpx;
    color: rgba(100, 80, 235, 1);
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .participationRecords_fd2_0_c4_c0_c3 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 20rpx 0rpx 20rpx;
  }

  .participationRecords_fd2_0_c3_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .participationRecords_fd2_0_c2_c0_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .participationRecords_fd2_0_c2_c0_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 10rpx 0rpx 0rpx;
  }

  .participationRecords_fd2_0_c2 {
    margin: 0rpx 0rpx 14rpx 0rpx;
  }

  .participationRecords_fd2_0_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 42rpx;
  }

  .participationRecords_fd2_0_c1 {
    margin: 24rpx 0rpx 24rpx 0rpx;
  }

  .participationRecords_fd2_0_c0_c1_c1_c0 {
    background: rgba(58, 134, 254, 0.1);
    color: #3A86FE;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    padding: 2rpx 10rpx 2rpx 10rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
    margin: 7rpx 14rpx 0rpx 0rpx;
  }

  .participationRecords_fd2_0_c0_c1_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 700;
    line-height: 42rpx;
  }

  .participationRecords_fd2_0_c0_c0 {
    width: 88rpx;
    height: 88rpx;
    border-radius: 12rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .participationRecords_fd2_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    margin: 0rpx 0rpx 24rpx 0rpx;
    padding: 32rpx 24rpx 32rpx 24rpx;
  }
</style>
